import React from "react";
import { returnType } from "./utils/index";
import { nameType } from "./utils/index";

type Props = {};
// 函数重载
function reLoad(name: nameType): returnType {
  if (typeof name === "string") {
    return name + "字符串类型";
  } else if (typeof name === "number") {
    return name + "是数字类型";
  }
}
console.log(reLoad("喜喜"), reLoad(111), "函数重载");

const nameType = (props: Props) => {
  return <div>nameType</div>;
};

export default nameType;
